<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="author" content="m.jd.com">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" type="text/css"
          href="/resources/wap/css/base2013.css" charset="gbk" />
    <link rel="stylesheet" type="text/css"
          href="/resources/wap/css/my.css?r=2" charset="gbk" />
    <link rel="stylesheet" type="text/css"
          href="/resources/wap/css/header.css" charset="gbk" />
    <script src="/resources/js/jquery-1.11.1.min.js"></script>
    <script src="/resources/js/self.js?r=1"></script>
     <style type="text/css">
         .level{
             background: #fff;
             height: 80px;
             padding: 20px;
             border-radius: 5px;
             margin-top: 4px;
         }
         .add{
             background-image: url("/resources/wap/image/add_1.png");
             background-size: 100px 100px;
             background-repeat: no-repeat;
             height: 100px;
             width: 100%;
             background-position: center;
         }

     </style>
</head>
<body>

<header>
    <!-- 通用头 div -->
    <div id="m_common_header" style="min-height: 45px; margin-top: 0px;">
        <header class="jd-header">
            <div class="jd-header-bar">
                <div  class="jd-header-icon-back J_ping" onclick="javascript:window.location.href='/html/wap/supplier/user_center.html'">
                    <span></span>
                </div>
                <div class="jd-header-title">
                    我的客户级别
                </div>
            </div>

        </header>
    </div>
</header>
<div class="common-wrapper" id="mainLayout">
    <!-- 通知中心 -->
    <div id="makeLocation" style="display:none">
        <div class="order-remind" id="orderRemind" style="display: none;">
            <div class="order-remind-flex" id="orderRemindFlex">
                <em class="order-remind-flex-pic-left"></em>
                <em class="order-remind-flex-pic-right" id="closeRemind"></em>
            </div>
        </div>
    </div>
    <!-- 通知中心 结束-->
    <div class="order-tab bdb-1px">

    </div>
    <div id="div_orderlist">
        <div id="data_list" style="position: relative; display: block;">

        </div>
        <div class="no-order" id="customerDataNote" style="display: block;">
        </div>
        <!--end if-->
    </div>
    <div align="center"  >
        <span class="add" style="display: block" onclick="add()"></span>
    </div>
    <div id="div_ordersort" class="o-order mar9 border-1px" style="display: none;">
        <ul id="ordersort-items" class="ordersort-items">

        </ul>
    </div>
    <div class="is-loading" style="height: 35px; padding-top: 2px; display: none;">
        <em></em>
        <span>加载中...</span>
    </div>
    <span class="black-content" id="tip"></span>


</div>
</body>
<script type="text/javascript">

    $().ready(function () {
        loadData();
    });
    function loadData(){

        $.ajax({
            url:"/wap/supplier/customerLevel/list.json?r="+Math.random(),
            data:{},
            dataType:'json',
            type:'post',
            success:function(data){
                if(data.success) {
                    if(!isNullOrUndefined(data.data)){
                        var html ="";
                        var defaultSetHtml  = "";
                        $(data.data).each(function (index,item) {

                            if(item.defaultSet ==="1"){
                                defaultSetHtml = "<span>默认</span>";
                            }else {
                                defaultSetHtml = "";
                            }
                            html = html+"<div class='level'>"+
                                    "<div style='float: left'><span>"+item.name+"</span>"+
                                defaultSetHtml+"</div>"+
                                    "<div style='float: right;margin-right:30px;width: 40px;height: 40px;" +
                                "background-repeat:no-repeat;background-size: 100% 100%;" +
                                "background-image:url(\"/resources/wap/image/setting.png\")' onclick='editCustomerLevel(\""+item.id+"\")'></div>"+

                                "</div>";
                        });
                        $("#data_list").html(html);
                    }

                }
            }
        });
    }
    function editCustomerLevel(id) {
        window.location.href="customer_level_edit.html?id="+id;
    }
    function add() {
        window.location.href="customer_level_edit.html";
    }
</script>
</html>